<?php include "db.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  

<title>Create Database Table</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>  
<body>  
<div id="main">

<?php

$query = "DROP TABLE IF EXISTS users";
$r = $mysqli->query($query);

if (!$r) {
	echo "Cannot execute query: $query\n";
	trigger_error(mysql_error()); 
} else {
	echo "Query: $query executed\n"; 
}
$query = "CREATE TABLE users(User_Id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(User_Id), Email CHAR(40), Password CHAR(16), PermissionLevel INT, FirstName CHAR(20), LastName CHAR(20), Chapter_Id INT)";
$r = $mysqli->query($query);

if (!$r) {
	echo "Cannot execute query: $query\n";
	trigger_error(mysql_error()); 
} else {
	echo "Query: $query executed\n"; 
}
?>

<h1> Created users table </h1>

<p> <a href="index.php"> Return to index page. </a> </p>


</div>
</body>
</html>